package com.sc.admin.common.exception;

import com.sc.admin.common.result.IResultCode;
import lombok.Getter;

import java.io.Serial;

/**
 * 自定义业务异常
 *
 * @author shen chen
 * @since 2022/7/31
 */
@Getter
public class BusinessException extends RuntimeException {

    @Serial
    private static final long serialVersionUID = -3878430250784656991L;
    public IResultCode resultCode;

    public BusinessException(IResultCode errorCode) {
        super(errorCode.getMsg());
        this.resultCode = errorCode;
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }


    public BusinessException(Throwable cause) {
        super(cause);
    }
}
